package org.dtrd.modules.patient.entity.bean.report;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.config.system.Constant;
import org.dtrd.modules.patient.entity.po.DtrdEntRdReport;

import java.util.Date;

/**
 * <p>
 * 患者报告
 * </p>
 *
 * @author QR
 * @since 2022-01-22
 */
@Getter
@Setter
@ApiModel(value = "患者报告列表信息", description = "患者报告")
public class ReportListInfo {

    private Integer dataId;

    @ApiModelProperty("患者id")
    private Integer patientId;

    @ApiModelProperty("报告名字")
    private String reportName;

    @ApiModelProperty("报告创建时间")
    @JsonFormat(pattern = Constant.TIME_PATTERN_SDF, timezone = "GMT+8")
    private Date reportCreateTime;

    @ApiModelProperty("报告发布时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date publishTime;

    @ApiModelProperty("报告状态 0-未发布，1-已发布")
    private Integer publishStatus;
    @ApiModelProperty("报告状态文本")
    private String publishStatusText;

    public ReportListInfo (DtrdEntRdReport po) {
        dataId = po.getDataId();
        patientId = po.getPatientId();
        reportName = po.getReportName();
        reportCreateTime = po.getCreateTime();
        publishTime = po.getPublishTime();
        publishStatus = po.getPublishStatus();
        publishStatusText = Constant.ReportPublishType.valueOf(po.getPublishStatus()).getName();
    }
}
